<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答办公系统-学科新增</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<!--<link rel="stylesheet" href="../../../../../../../../Desktop/在线办公系统-SSM框架/素材/Web1903/media/layui/css/layui.css" media="all">-->
<link rel="stylesheet" href="/media/layui/css/layui.css" media="all">
	<script src="../../media/js/jquery.min.js"></script>

</head>
<body>

	<div class="layui-container" style="margin-top: 5px">
		<form class="layui-form" action="/Major_add" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">学科名称</label>
				<div class="layui-input-block">
					<input type="text" name="majorName" lay-verify="name" autocomplete="off"
						placeholder="请输入名称" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">成立日期</label>
				<div class="layui-input-block">
				 <input type="text" name="majorDate" id="date" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学科周期</label>
				<div class="layui-input-block">
					<input type="text" name="majorTime" lay-verify="name" autocomplete="off"
						placeholder="请输入周期" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学科类型</label>
				<div class="layui-input-block">
					<select name="majorType" id="types">
<!--						<option value="1">普通</option>-->
<!--						<option value="2">精品</option>-->
<!--						<option value="3">业余</option>-->
					</select>
				</div>
			</div>
			
			<div class="layui-form-item">
				<input class="layui-btn" style="margin-left: 10%" type="submit" value="确认新增">
			</div>
		</form>
	</div>


<!--	<script src="../../../../../../../../Desktop/在线办公系统-SSM框架/素材/Web1903/media/layui/layui.js"></script>-->
	<script src="/media/layui/layui.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		//异步加载下拉框
		$(function () {
			$.getJSON("/Major_findTypeMajor",function (result) {
				// alert(result[0].majortype)
				for (var i=0;i<result.length;i++){
					$("#types").append("<option value='"+result[i].id+"'>"+result[i].majortype+"</option>")
				}
				layui.use(
						[ 'form', 'laydate' ],
						function() {
							var form = layui.form, layer = layui.layer, laydate = layui.laydate;

							//日期
							laydate.render({
								elem : '#date'
							});

							// //自定义验证规则
							// form.verify({
							// 	title : function(value) {
							// 		if (value.length < 5) {
							// 			return '标题至少得5个字符啊';
							// 		}
							// 	},
							// 	pass : [ /(.+){6,12}$/, '密码必须6到12位' ],
							// 	content : function(value) {
							// 		layedit.sync(editIndex);
							// 	}
							// });
						});
			})
		})


	</script>
</body>
</html>